/*
 * Author: Alvin
 * Modified By: Alvin
 * Created Date: 2024-05-10 10:39:54
 * Last Modified: 2024-05-13 17:50:51
 * Description:
 */
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:yt_devops/pages/site/site_setting/site_setting_base_info/widgets/picture_header_widget.dart';
import 'package:yt_devops/styles/styles.dart';

class LowCodeSingleFormExample {
  String title = "单表单示例-参照新建站点页";
  bool canSubmit = false;
  List initDataList = [];

  Map<String, dynamic> servicesConfig = <String, dynamic>{
    'initDataService': {},
    'updateDataService': {},
    'saveDataService': {
      "url": '/prod-api/system/site/create',
      "method": 'post',
      "params": {
        "id": 1,
      },
    },
  };

  List<Map<String, dynamic>> formConfig = [
    {
      "groupTitle": '',
      "childrens": [
        {
          "title": '安装商'.tr,
          "type": 2,
          "value": '',
          "Paramkey": 'orgs',
          "isRequired": true,
          "hintTextString": '未选择'.tr,
          "selectList": [
            {"name": '永泰测试组安装商', "value": 250},
            {"name": '华中新能源安装商', "value": 242},
            {"name": '雷欧安装商', "value": 240}
          ],
          "rightSlot": Image.asset(
            'assets/images/right_arrow.png',
            width: 16,
            height: 16,
          ),
        },
        {
          "title": '站点名称'.tr,
          "type": 0,
          "value": '',
          "Paramkey": 'name',
          "isRequired": true,
          "hintTextString": '请输入'.tr,
        },
        {
          "title": '地图类型'.tr,
          "type": 2,
          "value": '0',
          "Paramkey": 'orgs',
          "isRequired": true,
          "hintTextString": '未选择'.tr,
          "selectList": [
            {"name": '高德地图', "value": 0},
            {"name": '谷歌地图', "value": 1},
          ],
          "rightSlot": Image.asset(
            'assets/images/right_arrow.png',
            width: 16,
            height: 16,
          ),
        },
        {
          "title": '站点地址'.tr,
          "type": 8,
          "value": '',
          "isRequired": true,
          "Paramkey": 'location',
          "rightSlot": Image.asset(
            'assets/images/site_base_info_location.png',
          ),
        },
      ],
    },
    {
      "groupTitle": '',
      "childrens": [
        {
          "title": '电压等级'.tr,
          "type": 0,
          "value": '',
          "Paramkey": 'name',
          "isRequired": false,
          "hintTextString": '请输入'.tr,
          "rightSlot": const Text(
            'kV',
            style: TextStyle(fontSize: 14, color: Colour.otherTextColor),
          ),
        },
        {
          "title": '变压器容量'.tr,
          "type": 0,
          "value": '',
          "Paramkey": 'name',
          "isRequired": false,
          "hintTextString": '请输入'.tr,
          "rightSlot": const Text(
            'kV',
            style: TextStyle(fontSize: 14, color: Colour.otherTextColor),
          ),
        },
        {
          "title": '光伏总容量'.tr,
          "type": 0,
          "value": '',
          "Paramkey": 'name',
          "isRequired": false,
          "hintTextString": '请输入'.tr,
          "rightSlot": const Text(
            'kV',
            style: TextStyle(fontSize: 14, color: Colour.otherTextColor),
          ),
        },
        {
          "title": '储能总容量'.tr,
          "type": 0,
          "value": '',
          "Paramkey": 'name',
          "isRequired": false,
          "hintTextString": '请输入'.tr,
          "rightSlot": const Text(
            'kV',
            style: TextStyle(fontSize: 14, color: Colour.otherTextColor),
          ),
        },
        {
          "title": '储能额定功率'.tr,
          "type": 0,
          "value": '',
          "Paramkey": 'name',
          "isRequired": false,
          "hintTextString": '请输入'.tr,
          "rightSlot": const Text(
            'kV',
            style: TextStyle(fontSize: 14, color: Colour.otherTextColor),
          ),
        },
        {
          "title": '充电桩总功率'.tr,
          "type": 0,
          "value": '',
          "Paramkey": 'name',
          "isRequired": false,
          "hintTextString": '请输入'.tr,
          "rightSlot": const Text(
            'kV',
            style: TextStyle(fontSize: 14, color: Colour.otherTextColor),
          ),
        },
      ],
    },
    {
      "groupTitle": '',
      "childrens": [
        {
          "title": '站点图表'.tr,
          "subTitle": '最多1张'.tr,
          "type": 6,
          "value": '',
          "Paramkey": 'orgs',
          "isRequired": false,
          "selectList": [],
          "maxPhotoCount": 1,
        },
      ],
    },
    {
      "groupTitle": '',
      "childrens": [
        {
          "title": '站点照片'.tr,
          "subTitle": '最多3张'.tr,
          "type": 6,
          "value": '',
          "Paramkey": 'orgs',
          "isRequired": false,
          "selectList": [],
          "maxPhotoCount": 3,
        },
      ],
    },
    {
      "groupTitle": '',
      "childrens": [
        {
          "title": '备注'.tr,
          "type": 7,
          "value": '',
          "Paramkey": 'orgs',
          "isRequired": false,
        },
      ],
    },
  ];
}
